Skip to content

Conversation

steveklabnik
Copy link
Contributor

and while let

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

}
```

If a [pattern][patterns] matches successfully, it binds any appropriate things
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“things” seems too colloquial to my taste.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure what word to use exactly, suggestions welcome :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry, maybe “binds any appropriate parts of the value to the identifiers in the pattern”? subvalues or substructures seem too jargony on the contrary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

## `while let`

In a similar fashion, `while let` can be used when you want to loop over the
result of a pattern. It turns code like this:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. It's not clear what is meant by “result of a pattern” since that's not a term we seem to use at all. Maybe:

In a similar fashion, while let can be used when you want to conditionally loop as long as a value matches a certain pattern. It turns code like this:

and while let
@steveklabnik
Copy link
Contributor Author

@jakub- thanks! Addressed on all fronts, and better for it. 😄

@ghost
Copy link

ghost commented Apr 21, 2015

Sweet!

@bors r+ 570b250 rollup

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Apr 21, 2015
bors added a commit that referenced this pull request Apr 21, 2015
@bors bors merged commit 570b250 into rust-lang:master Apr 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants